<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <base href="../../" />
    <script src="list.js"></script>
    <script src="page.js"></script>
    <link type="text/css" rel="stylesheet" href="page.css" />
  </head>
  <body>

    <h1>[name]</h1>

    <div class="desc">
    A timed sequence of [link:https://en.wikipedia.org/wiki/Key_frame keyframes] for animating
    a specific property of an object.
    </div>


    <h2>Constructor</h2>


    <h3>[name]( [page:String name], [page:Array times], [page:Array values], [page:Constant interpolation] )</h3>
    <div>
      -- [page:String name] (required) identifier for the KeyframeTrack.<br />
      -- [page:Array times] (required) array of keyframe times<br />
      -- [page:Array values] values for the keyframes at the times specified.<br />
      -- [page:Constant interpolation] the type of interpolation to use. See [page:Animation Animation Constants] for possible values.
      Default is [page:Animation InterpolateLinear].
    </div>

    <h2>Properties</h2>


    <h3>[property:String name]</h3>
    <div>
    The name given to the KeyframeTrack in the constructor.
    </div>

    <h3>[property:Float32Array times]</h3>
    <div>
    [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
    of keyframe times.
    </div>

    <h3>[property:Float32Array values]</h3>
    <div>
    [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array]
    of keyframe values, corresponding to the [page:KeyframeTrack.times times].
    </div>

    <h3>[property:Constant DefaultInterpolation]</h3>
    <div>
    The default tnterpolation type to use, [page:Animation InterpolateLinear].
    </div>


    <h2>Methods</h2>

    <h3>[method:null createInterpolant ](  )</h3>
    <div>
      Create a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant]
      or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter
      passed in the constructor.
    </div>

    <h3>[method:null getInterpolation ](  )</h3>
    <div>
      Get the interpolation type.
    </div>

    <h3>[method:Number getValueSize ](  )</h3>
    <div>
      The the size of each value (length of the values array divied by length of times array).
    </div>

    <h3>[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete ]( result )</h3>
    <div>
      Create a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times]
      and [page:KeyframeTrack.times values].
    </div>

    <h3>[method:null InterpolantFactoryMethodLinear ](  )</h3>
    <div>
      Create a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times]
      and [page:KeyframeTrack.times values].
    </div>

    <h3>[method:null InterpolantFactoryMethodSmooth ](  )</h3>
    <div>
      Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times]
      and [page:KeyframeTrack.times values].
    </div>

    <h3>[method:null optimize ](  )</h3>
    <div>
      Remove equivalent sequential keys, which are common in morph target sequences. <br />
  	  Called automatically by the constructor.
    </div>

    <h3>[method:KeyframeTrack parse]( [page:JSON json] )</h3>
    <div>
    Parse json and return new keyframe track of the correct type.
    </div>

    <h3>[method:null scale ](  )</h3>
    <div>
      Scale all keyframe times by a factor (useful for frame <-> seconds conversions).
    </div>

    <h3>[method:null setInterpolation ]( [page:Constant interpolation] )</h3>
    <div>
      Set the interpolation type. See [page:Animation animation constants] for choices.
    </div>

    <h3>[method:null shift ]( [page:Number timeOffset] )</h3>
    <div>
      Move all keyframes either forwards or backwards in time.
    </div>

    <h3>[method:null TimeBufferType ](  )</h3>
    <div>
      [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
      used to convert the times array passed in the constructor to a Float32Array.
    </div>

    <h3>[method:JSON toJSON]( [page:KeyframeTrack track] )</h3>
    <div>
    Convert the track to JSON.
    </div>

    <h3>[method:null trim ]( [page:Number startTime], [page:Number endTime] )</h3>
    <div>
      Removes keyframes before [page:Number startTime] and after [page:Number endTime]
      without changing any values within the range [[page:Number startTime], [page:Number endTime]].
    </div>

    <h3>[method:null validate ](  )</h3>
    <div>
      Perform minimal validation on the tracks. Called automatically by the constructor.
    </div>

    <h3>[method:null ValueBufferType ](  )</h3>
    <div>
      [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array],
      used to convert the values array passed in the constructor to a Float32Array.
    </div>

    <h2>Source</h2>


    [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  </body>
</html>
